import http from "@/api";

/**
 * 广告列表
 */
export const advertiseListApi = (params: object) => {
    return http.get(`/advertise/list`, params);
};

/**
 * 广告分页列表
 */
export const advertisePageListApi = (params: object) => {
    return http.get(`/advertise/paging`, params);
};

/**
 * 新增广告
 * @param params
 */
export const addAdvertiseApi = (params: object) => {
    return http.post(`/advertise/add`, params);
};

/**
 * 编辑广告
 * @param params
 */
export const editAdvertiseApi = (params: any) => {
    return http.put(`/advertise/edit/${params.id}`, params);
};

/**
 * 切换广告状态
 * @param id
 */
export const changeStatusApi = (id: number) => {
    return http.put(`/advertise/change_status/${id}`);
};

/**
 * 修改排序
 * @param params
 */
export const changeSortApi = (params: object) => {
    return http.post(`/advertise/changeSort`, params);
};

/**
 * 删除广告
 * @param id
 */
export const deleteAdvertiseByIdApi = (id: number) => {
    return http.delete(`/advertise/delete/${id}`);
};

/**
 * 批量删除
 * @param params
 */
export const deleteAdvertiseApi = (params: object) => {
    return http.post(`/advertise/delete`, params);
};
